Component({
  data: {
    active: 'home',
    list: [{
        pagePath: "/pages/index/index",
        text: "首页",
        icon: "home-o",
        name: "home"
    },{
        pagePath: "/pages/find/index",
        text: "发现",
        icon: "search",
        name: "search"
    },{
       pagePath: "/pages/strategy/index",
       text: "攻略",
       icon: "orders-o",
       name: "strategy"
    },{
       pagePath: "/pages/my/index",
       text: "我的",
       icon: "manager-o", 
       name: "setting"
    }]
  },
  methods: {
    onChange(event) {
      const { pagePath } = this.data.list.find(i => i.name === event.detail)
      wx.switchTab({ url: pagePath })
    }
  }
})
